package com.linzm.template;

import java.security.SecureRandom;
import java.util.concurrent.TimeUnit;
import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReentrantLock;

/**
 * @Author zimingl
 * @Date 2023/5/4 22:43
 * @Description: 牛奶
 */
public class Milk extends AbstractDrinksTemplate {
    @Override
    protected void printName() {
        System.out.println(name);
    }

    @Override
    protected void printPrice() {
        System.out.println(price);
    }

    private Lock lock = new ReentrantLock();

    @Override
    protected void printCount() {
        try {
            TimeUnit.MILLISECONDS.sleep(new SecureRandom().nextInt(1000));
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }
        System.out.println(count);
    }
}
